<template>
  <van-tag type="primary">{{ dayText }}</van-tag>
</template>
<script setup>
import { ref, onBeforeUpdate, onMounted } from 'vue';
const props = defineProps({
  day: Number
})
const dayText = ref('');

onMounted(() => {
  dayText.value = props.day === 0 ? '今天' : `${props.day}天前`
})
</script>